#define _CRT_SECURE_NO_WARNINGS 1

#include"string.h"

int main()
{
	xc::string s1("hello world");
	for (char ch : s1)
	{
		cout << ch ;
	}
	cout << endl;
	s1 += 'b';
	s1.resize(20, 'c');
	for (char ch : s1)
	{
		cout << ch;
	}
	cout << endl;
	
	s1.clear();
	s1.append("hello world");
	for (char ch : s1)
	{
		cout << ch;
	}
	cout << endl;

	s1.insert(0, 'a');
	for (char ch : s1)
	{
		cout << ch;
	}
	cout << endl;

	s1.insert(0, "abcd");
	for (char ch : s1)
	{
		cout << ch;
	}
	cout << endl;

	s1.erase(0, 5);
	for (char ch : s1)
	{
		cout << ch;
	}
	cout << endl;

	cout << s1.find('w') << endl;
	cout << s1.find("el") << endl;

	xc::string s2("hello C++");
	s1.swap(s2);
	for (char ch : s1)
	{
		cout << ch;
	}
	cout << endl;
	for (char ch : s2)
	{
		cout << ch;
	}
	cout << endl;


	cout << s1 << endl;
	cin >> s1;
	cout << s1 << endl;
	return 0;
}